﻿<%@ Page Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="com.dz.web.Register" Title="用户注册" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphContent" runat="server">
<script src="/javascript/ajax.js" type="text/javascript"></script>
<style>

.g_main {
	MARGIN: 0px auto; WIDTH: 960px
}
.g_main .mainl {
	WIDTH: 700px
}
.g_main .mainr {
	MARGIN-TOP: 32px; WIDTH: 242px
}
.g_main .mainr0 {
	WIDTH: 242px
}
.deals {
	MARGIN: 10px auto; WIDTH: 690px
}
.deals .top {
	HEIGHT: 8px
}
.deals .mid {
	BACKGROUND: url(/images/bg_scodmid.png) repeat-y
}
.deals .bom {
	HEIGHT: 8px
}
.deals .fudong {
	POSITION: relative; MARGIN-TOP: 30px
}

.kuangaa_login {
	BORDER-BOTTOM: #89b4d6 1px solid; BORDER-LEFT: #89b4d6 1px solid; PADDING-BOTTOM: 4px; PADDING-LEFT: 4px; WIDTH: 280px; PADDING-RIGHT: 4px; COLOR: #333; FONT-SIZE: 13px; VERTICAL-ALIGN: middle; BORDER-TOP: #89b4d6 1px solid; FONT-WEIGHT: bold; BORDER-RIGHT: #89b4d6 1px solid; PADDING-TOP: 4px
}
.gbt_line {
	BORDER-BOTTOM: #fbd686 1px solid; PADDING-BOTTOM: 15px; LINE-HEIGHT: 30px; PADDING-LEFT: 20px; PADDING-RIGHT: 20px; FONT-SIZE: 28px; FONT-WEIGHT: bold; PADDING-TOP: 15px
}
.g_main .mainr {
	MARGIN-TOP: 32px; WIDTH: 235px;
}
.r {
	FLOAT: right;
}
.btn {
 BORDER-RIGHT: #7b9ebd 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7b9ebd 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 12px; FILTER: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#cecfde); BORDER-LEFT: #7b9ebd 1px solid; CURSOR: hand; COLOR: black; PADDING-TOP: 2px; BORDER-BOTTOM: #7b9ebd 1px solid; height:30px; 
}
</style>

<DIV class=g_main>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><DIV class="l mainl">
<DIV class=deals>
<DIV class=top><IMG src="/images/bg_scodtop.png"></DIV>
<DIV class=mid>
<DIV class=gbt_line>
<DIV class=l>注册 <SPAN style="FONT-SIZE: 14px; FONT-WEIGHT: normal"></SPAN></DIV>
<DIV class=c></DIV></DIV>
<DIV class=sect>
<TABLE border=0 cellSpacing=0 cellPadding=0 width="100%" align=center>
  <TBODY>
  <TR>
    <TD style="FONT-SIZE: 14px" height=50 align=right><FONT color=red>*</FONT> 
      邮　　箱：</TD>
    <TD width="75%"><INPUT id="email" class=kuangaa_login maxLength=200 size=28 > </TD></TR>
  <TR>
    <TD style="FONT-SIZE: 14px" height=50 align=right><FONT color=red>*</FONT> 
      用户名称：</TD>
    <TD><INPUT id="userName" class=kuangaa_login size=28  ></TD></TR>
  <TR>
    <TD style="FONT-SIZE: 14px" height=50 align=right><FONT color=red>*</FONT> 
      用户密码：</TD>
    <TD><INPUT id="pwd" class=kuangaa_login size=28 type=password 
></TD></TR>
  <TR>
    <TD style="FONT-SIZE: 14px" height=50 align=right><FONT color=red>*</FONT> 
      确认密码：</TD>
    <TD><INPUT id="pwd2" class=kuangaa_login size=28 type=password 
></TD></TR>
    <TR>
    <TD style="FONT-SIZE: 14px" height=50 align=right><FONT color=red>*</FONT> 
      昵&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称：</TD>
    <TD><INPUT id="nickName" class=kuangaa_login size=28  
></TD></TR>

  <TR>
    <TD style="FONT-SIZE: 14px" height=50 align=right><FONT color=red>*</FONT> 
      验 证 码：</TD>
    <TD><INPUT style="WIDTH: 60px" class=kuangaa_login maxLength=4 size=4  id="code"
      > <IMG id=chkimg name=chkimg align=absMiddle 
      src="/VerifyCode.aspx?" width=65 height=20> <SPAN 
      style="CURSOR: pointer" onclick="javascript:document.getElementById('chkimg').src=document.getElementById('chkimg').src+'?';">看不清，换一张</SPAN>
   
       </TD></TR>


  <TR>
    <TD style="FONT-SIZE: 14px" height=20 align=right></TD>
    <TD><INPUT class="btn" type=button value="注 册" onclick="RegisterUser()" > 
      </TD></TR></TBODY></TABLE></DIV></DIV>
<DIV class=bom><IMG src="/images/bg_scodbom.png"></DIV></DIV></DIV>
<script>
var returnUrl="<%=m_return_url %>";
function RegisterUser()
{
    var email=$("email");
    var userName=$("userName");
    var pwd=$("pwd");
    var pwd2=$("pwd2");
    var nickName=$("nickName");
    var code=$("code");
    if(email.value=="")
    {
        alert("请输入邮箱!");
        email.focus();
        return false;
    }
    if(isEmail(email.value)==false)
    {
        alert("邮箱地址格式不正确!");
        email.focus();
        return false;
    }
    if(userName.value=="")
    {
        alert("请输入用户名!");
        userName.focus();
        return false;
    }
    if(pwd.value=="")
    {
        alert("请输入密码!")
        pwd.focus();
        return false;
    }
    if(pwd2.value=="")
    {
        alert("请输入确认密码!");
        pwd2.focus();
        return false;
    }
    if(pwd.value!=pwd2.value)
    {
        alert("两次密码不相同!");
        return false;
    }
    if(nickName.value=="")
    {
        alert("请输入昵称!");
        nickName.focus();
        return false;
    }
    if(code.value=="")
    {
        alert("请输入验证码!");
        code.focus();
        return false;
    }
    
    var script=email.value+"$"+userName.value+"$"+pwd.value+"$"+nickName.value+"$"+code.value;
    MyAjax.ExcuteScript("register",script,ShowBack);
    
}
function isEmail(str){ 
res = /^[0-9a-zA-Z_\-\.]+@[0-9a-zA-Z_\-]+(\.[0-9a-zA-Z_\-]+)*$/; 
var re = new RegExp(res); 
return !(str.match(re) == null); 
} 

function ShowBack(result)
{
    if(result.value.indexOf("成功")>-1)
    {
        window.location.href=returnUrl;
    }
    else
    {
        alert(result.value);
    }
}
</script>

</td>
<td valign="top" class="r">
<!-- 右侧-->
<DIV style="MARGIN-TOP: 0px; margin-left:10px;" class="r mainr">
<DIV style="float:right;">
 <DIV class=hr10></DIV>
<DIV class="phb">
<DIV class=left>
<DIV class=hd>
<H3>热门图书</H3></DIV>

<asp:Label ID="lblTopClick" runat="server"></asp:Label>
</DIV>
 <DIV class=hr10></DIV>
 </DIV>
</DIV>
</DIV></td>
</tr>
</table>

</asp:Content>
